import bpmProcessListenerApi from "@/api/declaration/bpm/bpmProcessListenerApi"
import httpRequest from "@/config/axios/httpRequest"
import { BpmProcessListenerModel } from "@/models/bpm/BpmProcessListenerModel"


// BPM 流程监听器 API
export const ProcessListenerApi = {
  // 查询流程监听器分页
  getProcessListenerPage: async (params: any) => {
    return await httpRequest.get(bpmProcessListenerApi.GetProcessListenerPage, { params })
  },

  // 查询流程监听器详情
  getProcessListener: async (id: number) => {
    return await httpRequest.get(bpmProcessListenerApi.GetProcessListener, { params: { id } })
  },

  // 新增流程监听器
  createProcessListener: async (data: BpmProcessListenerModel) => {
    return await httpRequest.post(bpmProcessListenerApi.CreateProcessListener, data)
  },

  // 修改流程监听器
  updateProcessListener: async (data: BpmProcessListenerModel) => {
    return await httpRequest.put(bpmProcessListenerApi.UpdateProcessListener, data)
  },

  // 删除流程监听器
  deleteProcessListener: async (id: number) => {
    return await httpRequest.delete(bpmProcessListenerApi.DeleteProcessListener, { params: { id } })
  }
}
